<% if repositories.present? %>
  <div class="crayons-card crayons-card--secondary">
    <header class="crayons-card__header">
      <h3 class="crayons-subtitle-3 flex items-center"><%= t("views.users.github.heading") %></h3>
    </header>

    <div>
      <% repositories.each do |repo| %>
        <a href="<%= repo.url %>" target="_blank" rel="noopener" class="crayons-link crayons-link--contentful">
          <p class="fw-bold flex items-center">
            <%= repo.name %>
          </p>
          <% if repo.description.present? %>
            <p class="fs-s color-base-80 mb-1"><%= Html::Parser.new(repo.description).parse_emojis.html %></p>
          <% end %>
          <p class="fs-s color-base-60 flex items-center">
            <% if repo.fork %>
              <span class="c-indicator mr-3"><%= t("views.users.github.fork") %></span>
            <% end %>

            <% if repo.language %>
              <%= repo.language %>
            <% end %>

            <% if repo.language && repo.stargazers_count.to_i > 0 %>
              <span class="opacity-50 inline-block px-1">&bull;</span>
            <% end %>

            <% if repo.stargazers_count.to_i > 0 %>
              <%= t("views.users.github.stars", count: repo.stargazers_count) %>
            <% end %>
          </p>
        </a>
      <% end %>
    </div>
  </div>
<% end %>
